#!/bin/sh
#从环境变量中读取用户名和密码
username=$1
password=$2
#在用户文件中查找给定用户名的密码
expected_password=$(grep "^${username}:" /etc/openvpn/server/user.txt | cut -d ':' -f 2)
#将预期密码与提供的密码进行比较
if [ "${password}" = "${expected_password}" ]; then
exit 0  # Authentication succeeded
else
exit 1  # Authentication failed
fi
